package com.yili.oa.dao;

import com.yili.oa.models.SignIn;
import com.yili.oa.models.SignInExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface SignInMapper {
    @SelectProvider(type=SignInSqlProvider.class, method="countByExample")
    long countByExample(SignInExample example);

    @DeleteProvider(type=SignInSqlProvider.class, method="deleteByExample")
    int deleteByExample(SignInExample example);

    @Delete({
        "delete from ft_sign_in",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into ft_sign_in (id, day, ",
        "money)",
        "values (#{id,jdbcType=VARCHAR}, #{day,jdbcType=INTEGER}, ",
        "#{money,jdbcType=REAL})"
    })
    int insert(SignIn record);

    @InsertProvider(type=SignInSqlProvider.class, method="insertSelective")
    int insertSelective(SignIn record);

    @SelectProvider(type=SignInSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="day", property="day", jdbcType=JdbcType.INTEGER),
        @Result(column="money", property="money", jdbcType=JdbcType.REAL)
    })
    List<SignIn> selectByExample(SignInExample example);

    @Select({
        "select",
        "id, day, money",
        "from ft_sign_in",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="day", property="day", jdbcType=JdbcType.INTEGER),
        @Result(column="money", property="money", jdbcType=JdbcType.REAL)
    })
    SignIn selectByPrimaryKey(String id);

    @UpdateProvider(type=SignInSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") SignIn record, @Param("example") SignInExample example);

    @UpdateProvider(type=SignInSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") SignIn record, @Param("example") SignInExample example);

    @UpdateProvider(type=SignInSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(SignIn record);

    @Update({
        "update ft_sign_in",
        "set day = #{day,jdbcType=INTEGER},",
          "money = #{money,jdbcType=REAL}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(SignIn record);
}